package com.assets.room.entity;

import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;

import java.io.Serializable;
import java.util.Date;

@Entity(tableName = "sys_user")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @ColumnInfo(name = "user_id")
    @PrimaryKey(autoGenerate = true)
    private Long userId;

    /**
     * 头像
     */
    @ColumnInfo(name = "avatar")
    private String avatar;

    /**
     * 账号
     */
    @ColumnInfo(name = "account")
    private String account;

    /**
     * 密码
     */
    @ColumnInfo(name = "password")
    private String password;

    /**
     * md5密码盐
     */
    @ColumnInfo(name = "salt")
    private String salt;

    /**
     * 名字
     */
    @ColumnInfo(name = "name")
    private String name;

    /**
     * 生日
     */
    @ColumnInfo(name = "birthday")
    private String birthday;

    /**
     * 性别(字典)
     */
    @ColumnInfo(name = "sex")
    private String sex;

    /**
     * 电子邮件
     */
    @ColumnInfo(name = "email")
    private String email;

    /**
     * 电话
     */
    @ColumnInfo(name = "phone")
    private String phone;

    /**
     * 角色id(多个逗号隔开)
     */
    @ColumnInfo(name = "role_id")
    private String roleId;

    /**
     * 部门id(多个逗号隔开)
     */
    @ColumnInfo(name = "dept_id")
    private Long deptId;

    /**
     * 状态(字典)
     */
    @ColumnInfo(name = "status")
    private String status;

    /**
     * 创建时间
     */
    @ColumnInfo(name = "create_time")
    private String createTime;

    /**
     * 创建人
     */
    @ColumnInfo(name = "create_user")
    private Long createUser;

    /**
     * 更新时间
     */
    @ColumnInfo(name = "update_time")
    private String updateTime;

    /**
     * 更新人
     */
    @ColumnInfo(name = "update_user")
    private Long updateUser;

    /**
     * 乐观锁
     */
    @ColumnInfo(name = "version")
    private Integer version;

    /**
     * 数据权限
     */
    @ColumnInfo(name = "data")
    private String data;

    @ColumnInfo(name = "is_flag")
    private String isFlag;

    @Ignore
    public User() {
    }

    public User(Long userId, String avatar, String account,
                String password, String salt, String name,
                String birthday, String sex, String email,
                String phone, String roleId, Long deptId,
                String status, String createTime, Long createUser,
                String updateTime, Long updateUser, Integer version,
                String data, String isFlag) {
        this.userId = userId;
        this.avatar = avatar;
        this.account = account;
        this.password = password;
        this.salt = salt;
        this.name = name;
        this.birthday = birthday;
        this.sex = sex;
        this.email = email;
        this.phone = phone;
        this.roleId = roleId;
        this.deptId = deptId;
        this.status = status;
        this.createTime = createTime;
        this.createUser = createUser;
        this.updateTime = updateTime;
        this.updateUser = updateUser;
        this.version = version;
        this.data = data;
        this.isFlag = isFlag;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public Long getCreateUser() {
        return createUser;
    }

    public void setCreateUser(Long createUser) {
        this.createUser = createUser;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public Long getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(Long updateUser) {
        this.updateUser = updateUser;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    public String getIsFlag() {
        return isFlag;
    }

    public void setIsFlag(String isFlag) {
        this.isFlag = isFlag;
    }

    @Override
    public String toString() {
        return "User{" +
                "userId=" + userId +
                ", avatar='" + avatar + '\'' +
                ", account='" + account + '\'' +
                ", password='" + password + '\'' +
                ", salt='" + salt + '\'' +
                ", name='" + name + '\'' +
                ", birthday='" + birthday + '\'' +
                ", sex='" + sex + '\'' +
                ", email='" + email + '\'' +
                ", phone='" + phone + '\'' +
                ", roleId='" + roleId + '\'' +
                ", deptId=" + deptId +
                ", status='" + status + '\'' +
                ", createTime='" + createTime + '\'' +
                ", createUser=" + createUser +
                ", updateTime='" + updateTime + '\'' +
                ", updateUser=" + updateUser +
                ", version=" + version +
                ", data='" + data + '\'' +
                ", isFlag=" + isFlag +
                '}';
    }
}